/**
* 版权声明：厦门睿商网络科技有限公司 版权所有 违者必究
* 日    期：2021-01-04
*/
package com.rzico.article.entity;

import com.rzico.annotation.IgnoreSwaggerParameter;
import com.rzico.basics.entity.Enterprise;
import com.rzico.basics.model.ProductVo;
import com.rzico.basics.model.ShopVo;
import lombok.Data;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * <pre>
 *   推荐平台数据库对象
 * </pre>
 * @author Rzico Boot
 * @version 1.0
 */
@Data
@JsonIgnoreProperties(value = {"handler"})
@JsonInclude(JsonInclude.Include.NON_NULL)
@Table(name = "wx_recommend")
public class Recommend{
    @Id
    @ApiModelProperty(value = "" )
    protected Long id;

    @ApiModelProperty(value = "创建日期" )
    protected java.util.Date createDate;

    @ApiModelProperty(value = "修改日期" )
    protected java.util.Date modifyDate;

    @ApiModelProperty(value = "推荐名称" )
    protected String name;

    @ApiModelProperty(value = "伟度" )
    protected Double lat;

    @ApiModelProperty(value = "经度" )
    protected Double lng;

    @ApiModelProperty(value = "所在区" )
    protected Integer areaId;

    @ApiModelProperty(value = "所在区" )
    protected String areaName;

    @ApiModelProperty(value = "排序" )
    protected Integer orders;

    @ApiModelProperty(value = "类型{0:商品,1:名店,2:酒店,3:名厨,4.餐车}" )
    protected Integer type;

    @ApiModelProperty(value = "类型ID" )
    protected Long typeId;

    @ApiModelProperty(value = "企业ID" )
    protected Long enterpriseId;

    /**
     *  会员
     */
    @JsonIgnore
    @IgnoreSwaggerParameter
    protected Enterprise enterprise;

    public String getMchName() {
        Enterprise enterprise = getEnterprise();
        if (enterprise!=null) {
            return enterprise.getName();
        } else {
            return null;
        }
    }

    public String getMchLogo() {
        Enterprise enterprise = getEnterprise();
        if (enterprise!=null) {
            return enterprise.getLogo();
        } else {
            return null;
        }
    }

}
